Possible syntax within the device object

Neuron Power Engineer supports the following syntax for a device configuration:

Syntax
DEVICE deviceConfig
  TYPE
    PTK := platform-name;
  END_TYPE
 
  COMMUNICATION
    (* optional_begin *) VIA comm_node_1; (* optional_end *) 
    TARGET comm_node_2;
  END_COMMUNICATION
END_DEVICE
 
COMMNODE comm_node_1
  PARAMS := 'jsonstring';
END_COMMNODE
 
COMMNODE comm_node_2
  PARAMS := 'jsonstring';
END_COMMNODE

The content for the device configuration results from the following sections/elements:

Section/element

Explanation

DEVICE name
  ...
END_DEVICE

declaration of a device configuration, name must be an →IEC-identifier

TYPE  PTK := platform-name;END_TYPE

platform for the device configuration

(info) Best practice is to use the content assist in order to select a platform form the list of the available platforms

COMMUNICATION
  (* optional_begin *) VIA comm_node_1; (* optional_end *) 
  TARGET comm_node_2;
END_COMMUNICATION

specification for the communication with the target system – the details for the target system are being defined in the named sections COMMNODE ... END_COMMNODE that are following

  • In case of a target system with a communication without →Gateway, you only need the statement TARGET incl. the relevant section. See the following example 1.

  • In case of a target system with a communication via Gateway, you need the additional statement VIA incl. the relevant section. See the following example 2.

COMMNODE comm_node_x
  PARAMS := 'jsonstring';
END_COMMNODE

details for the communication with the target system
Mind the following: 

  • The specifications within PARAMS is a JSON string and depends on the used target system. Contact the vendor of the PLC or Neuron, whether the device configuration is possible for the target system and which specifications are required.

  • A JSON string within the device object must not be longer than 1,023 characters.

Example 1: Device configuration in case of a communication without Gateway
DEVICE deviceConfig1
  TYPE
    PTK := SafeLibraryWindowsX86;
  END_TYPE
  COMMUNICATION
    TARGET plc;
  END_COMMUNICATION
END_DEVICE
 
COMMNODE plc
  PARAMS := '{"ipAddress": "127.0.0.1", "port": 1535}';
END_COMMNODE
Example 2: Device configuration in case of a communication via Gateway
DEVICE deviceConfig2
  TYPE
    PTK := SafeLibraryWindowsX86;
  END_TYPE
    
  COMMUNICATION
    VIA gateway1;
    TARGET plc1;
  END_COMMUNICATION
END_DEVICE
 
COMMNODE gateway1
  PARAMS := '{"ipAddress": "127.0.0.1", "port": 1535}';
END_COMMNODE
 
COMMNODE plc1
  PARAMS := 
    '
    {
      "transport" : {
        "type": "websockets",
        "parameters" : {
          "ip": "127.0.0.1",
          "port": 8081
        }
      },
      "infrastructure" : {
        "programmer": "STARTLOCAL",
        "parameters" : "8081"
      }
  }
  ';
END_COMMNODE